To transfer data such as an image between communication apparatuses, it is necessary to establish a physical layer, decide on an IP address to be used in an IP (Internet Protocol) layer, and establish a transport layer between the communication apparatuses (U.S. Pat. No. 6,754,200 (Japanese Patent Laid-Open No. 11-243419)).
The IEEE802.11 standards define ad hoc communication requiring no access point function. When performing wireless communication across an ad hoc network using this ad hoc communication, it is necessary to establish the individual communication layers described above.
To establish these communication layers in the ad hoc network, each device must execute a role in each communication layer.
The roles of the individual communication layers in the ad hoc network, e.g., the roles of the physical layer are a joiner and creator as functional roles in the ad hoc mode of a wireless LAN. Also, the roles of the IP layer as an upper layer are an RARP server and RARP client as functional roles which resolve an IP address from a MAC address.
In addition, the roles of the transport layer as a still upper layer are an initiator and responder of PTP (Picture Transfer Protocol)/IP communication. Furthermore, an application layer as a still upper layer has a role of deciding which device is to be given priority control if control operations of these devices conflict with each other in the application layer.
In the ad hoc network described above, the relationships between individual devices are equal. Therefore, each device cannot determine a role to be executed in each communication layer, and hence must execute both the roles. That is, as the roles of the physical layer, each device executes both the roles of the joiner and creator as the functional roles in the ad hoc mode. Also, as the roles of the IP layer, each device executes both the roles of the RARP server and RARP client. Additionally, as the roles of the transport layer, each device executes both the roles of the initiator and responder of PTP/IP communication. Furthermore, as the role of the application layer, each device must perform communication for deciding on the priority control.
This increases the processing load on each device. The processing load particularly increases in a built-in device having limited resources such as a CPU and memory, and interferes with other processes.
If the role of each communication layer is set by a user operation in order to reduce the processing load, the user is forced to perform advanced, complicated settings.
Also, to perform communication between a plurality of apparatuses by imparting the functional role of each communication layer to one apparatus, for example, the user is forced to perform menu selection for limiting roles such as an image sender and image receiver at the time of activation of communication. The user is also forced to perform menu selection for limiting roles such as a communication server and communication client. This makes the user unable to satisfy the demand for performing communication in an equal relationship from the user's viewpoint.